<template>
    <div class="tourist_container">
        <div class="top">
            <p class="title">实时游客统计</p>
            <p class="bg"></p>

            <p class="right">可预约总量 <span>99999</span> 人</p>
        </div>

        <div class="number">
            <span v-for="(item, index) in people" :key="index"> {{ item }}</span>
        </div>

        <!-- 展示图形图标的数据 -->
        <div class="charts" ref="charts">

        </div>
    </div>
</template>

<script setup lang='ts' name='Tourist'>
import { onMounted, ref } from 'vue';
import * as echarts from 'echarts';
/// 水球图
import 'echarts-liquidfill'

let people = ref('2153773人')


let charts = ref()

onMounted(() => {
    // 获取echarts实例
    let myCharts = echarts.init(charts.value)

    // 设置实例的配置项
    myCharts.setOption({
        /// 标题设置
        title: {
            text: '水球图'
        },

        //系列：决定你展示什么样的图形图标
        series: {
            type: 'liquidFill',
            data: [0.6, 0.4, 0.2],
            waveAnimation: true, // 是否要动画 
            animationDuration: 0,
            animationDurationUpdate: 0,
            radius: '80%'
        },
        // 布局组件
        grid: {
            left: 0,
            right: 0,
            top: 0,
            bottom: 0,
        }
    })
});


</script>

<style scoped lang='scss'>
.tourist_container {
    background: url(../../images/dataScreen-main-lb.png) no-repeat;
    background-size: 100% 100%;
    margin-top: 20px;
    padding: 0px 20px;

    .top {

        .title {
            color: white;
            font-size: 20px;
        }

        .bg {
            width: 68px;
            height: 7px;
            background: url(../../images/dataScreen-title.png) no-repeat;
            background-size: 100% 100%;
            margin-top: 10px;
        }

        .right {
            float: right;
            color: white;
            font-size: 15px;

            span {
                color: yellow;
            }
        }

    }

    .number {
        margin-top: 45px;
        display: flex;

        span {
            flex: 1;
            height: 40px;
            text-align: center;
            line-height: 40px;
            background: url(../../images/total.png) no-repeat;
            color: #29fcff;
        }
    }

    .charts {
        width: 100%;
        height: 200px;
        margin-top: 10px;
    }
}
</style>